home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 2 / 002.d81 / hiding memory a < prev    next >
Text File  |  2022-08-26  |  2KB  |  137 lines

  1.            -- P.B.A.R --
  2.  
  3.  
  4.   Have you ever wondered where your
  5.  
  6. BASIC programs are stored in memory?
  7.  
  8. This article is designed to help you
  9.  
  10. understand that, as well as utilize
  11.  
  12. some extraordinary storage
  13.  
  14. capabilities of the C-64.
  15.  
  16.   On this issue of LOADSTAR, after the
  17.  
  18. Paperless Pages or the INFLUX sections
  19.  
  20. load once, further loadings of these
  21.  
  22. sections take far less time.  This is
  23.  
  24. due to a small trick that I call
  25.  
  26. 'P.B.A.R.', which is short for- 'PRO-
  27.  
  28. GRAM BURIAL AND RETRIEVAL'.
  29.  
  30.   First of all, there are two memory
  31.  
  32. locations in your C-64 which are very
  33.  
  34. important for this trick.  These
  35.  
  36. locations are 43 and 44.
  37.  
  38.   During normal operation, if you do
  39.  
  40. this:
  41.       >print peek(43),peek(44)
  42.  
  43. you should get this:
  44.  
  45.       >     1       8
  46.  
  47. These two values (1,8) are the normal
  48.  
  49. values for the pointer which tells the
  50.  
  51. computer where to find the BOTTOM of
  52.  
  53. BASIC STORAGE.
  54.  
  55.   In the Commodore Programmer's Ref-
  56.  
  57. erence guide, page 320, it is stated
  58.  
  59. that the NORMAL BASIC PROGRAM SPACE
  60.  
  61. is located from 2048-40959.
  62.  
  63.   Now, if you take your two previous
  64.  
  65. values and do this:
  66.  
  67.       >print 1+8*256
  68.  
  69.    which is the same as:
  70.  
  71.       >print peek(43)+peek(44)*256
  72.  
  73.    you should get:
  74.  
  75.       >2049
  76.  
  77.    which was just stated to be the
  78.  
  79. BOTTOM of BASIC STORAGE.
  80.  
  81.   When you load a program into your
  82.  
  83. computer, it is stored starting at
  84.  
  85. 2049.  Now if we change the pointers
  86.  
  87. (locations 43 & 44) to make the
  88.  
  89. computer think basic is elsewhere,
  90.  
  91. then that's where the computer will
  92.  
  93. put your program.  The address where
  94.  
  95. your program is loaded can be found by
  96.  
  97. the formula we used above.  HINT:
  98.  
  99. it looks like this:
  100.  
  101.         >print peek(xx)+peek(xx)*256
  102.  
  103. The locations are changed by using
  104.  
  105. a statement like this:
  106.  
  107.         >poke43,xx:poke44,xx
  108.  
  109. For the Paperless Pages and INFLUX, I
  110.  
  111. used the statement:
  112.  
  113.         >poke43,1:poke44,25
  114.  
  115. and then loaded the appropriate pro-
  116.  
  117. gram.  The actual address where the
  118.  
  119. computer will start to load the
  120.  
  121. program is:
  122.  
  123.         >print 1+25*256
  124.  
  125.               or
  126.  
  127.         > 6401
  128.  
  129. This tells the computer to start
  130.  
  131. loading at 6401 insted of the normal
  132.  
  133. 2049.
  134.  
  135. -------------(continued)--------------
  136.              (x to exit)
  137.